package com.juc.phaser.phaser16;

import java.util.concurrent.Phaser;

public class Run2 {

	public static void main(String[] args) throws InterruptedException {

		Phaser phaser = new Phaser(3);
		ThreadA a = new ThreadA(phaser);
		a.setName("A");
		a.start();

		ThreadB b = new ThreadB(phaser);
		b.setName("B");
		b.start();
		
		Thread.sleep(1000);
		phaser.forceTermination();
		System.out.println(phaser.isTerminated());
	}
}
